package com.hpq.chat.service.impl;

import com.hpq.chat.dao.RoomFriendDAO;
import com.hpq.chat.domain.model.RoomFriend;
import com.hpq.chat.domain.model.RoomGroup;
import com.hpq.chat.domain.vo.response.ChatRoomResp;
import com.hpq.chat.service.RoomService;
import com.hpq.chat.service.adapter.ChatAdapter;
import com.hpq.common.domain.vo.request.CursorPageBaseReq;
import com.hpq.common.domain.vo.response.CursorPageBaseResp;
import com.hpq.common.utils.AssertUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Slf4j
@Service
public class RoomServiceImpl implements RoomService {

@Autowired
private RoomFriendDAO roomFriendDao;
    @Override
    public RoomFriend createFriendRoom(List<Long> uidList) {
        return null;
    }

    @Override
    public RoomFriend getFriendRoom(Long uid1, Long uid2) {
        return null;
    }

    /**
     * 禁用房间
     * @param uidList
     */
    @Override
    public void disableFriendRoom(List<Long> uidList) {
        AssertUtil.isEmpty(uidList,"好友数量不对，房间创建失败");
        AssertUtil.isNotEqual(uidList.size(),2,"好友数量不对,房间创建失败");
        String roomKey = ChatAdapter.generateRoomKey(uidList);
        roomFriendDao.disableRoom(roomKey);
    }

    @Override
    public RoomGroup createGroupRoom(Long uid) {
        return null;
    }

}
